package com.quick.android.activity;

import com.quick.android.app.ActivityManager;
import com.quick.android.utils.LogUtils;

import android.app.Activity;
import android.os.Bundle;

public abstract class BaseActivity extends Activity {
	public static final String TAG = BaseActivity.class.getSimpleName();

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		LogUtils.d(TAG, "activity_onCreate");
		initViews();
		getIntentData();
		initData(savedInstanceState);
		ActivityManager.getInstance().addActivity(this);
	}

	/** 初始化界面和控件 */
	public abstract void initViews();

	/** 获取Intent传送的参数 */
	public abstract void getIntentData();

	/** 初始化数据 */
	public abstract void initData(Bundle savedInstanceState);

	@Override
	protected void onPause() {
		super.onPause();
		LogUtils.d(TAG, "activity_onPause");
	}

	@Override
	protected void onResume() {
		super.onResume();
		LogUtils.d(TAG, "activity_onResume");
	}

	@Override
	protected void onStop() {
		super.onStop();
		LogUtils.d(TAG, "activity_onStop");
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
		LogUtils.d(TAG, "activity_onDestroy");
	}
}
